package com.xjoyt.pay.merchant.register.interfaces;

import java.util.Map.Entry;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.merchant.register.params.CreateDistributorParam;
import com.xjoyt.pay.merchant.register.params.DistributorPageParam;
import com.xjoyt.pay.merchant.register.po.Distributor;

public interface DistributorContract {

	@RequestMapping("get/{id}")
	Distributor get(@PathVariable("id") String id);

	/**
	 * 创建数据
	 * 
	 * @param param
	 * @return
	 */
	@RequestMapping("create")
	ExecuteResult<Distributor> create(CreateDistributorParam param);

	/**
	 * 临时保存数据
	 * 
	 * @param id
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("saveValue/{id}")
	ExecuteResult<?> saveValue(@PathVariable("id") String id, Entry<String, String> param) throws Exception;

	/**
	 * 提交注册
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping("submit/{id}")
	ExecuteResult<?> submit(@PathVariable("id") String id);

	/**
	 * 审核
	 * 
	 * @param param
	 * @return
	 */
	@RequestMapping(value = "check/{id}/{status}")
	ExecuteResult<Distributor> check(@PathVariable("id") String id, @PathVariable("status") Integer status);

	@RequestMapping(value = "save", method = RequestMethod.POST)
	ExecuteResult<Distributor> save(Distributor entity);

	@RequestMapping(value = "loadPage", method = RequestMethod.POST)
	PageResult<com.xjoyt.pay.merchant.register.vo.Distributor> loadPage(PageParam<DistributorPageParam> param);
}
